package model;

public class Book extends Resource {
    private final String author;
    private final String isbn;
    private final int edition;
    private static final int LOAN_PERIOD = 30; // 30天借阅期

    public Book(String id, String title, String author, String isbn, int edition) {
        super(id, title);
        this.author = author;
        this.isbn = isbn;
        this.edition = edition;
    }

    @Override
    public String getDetails() {
        return String.format("Book: %s\nAuthor: %s\nISBN: %s\nEdition: %d\nID: %s",
                getTitle(), author, isbn, edition, getId());
    }

    @Override
    public boolean borrow(String borrowerId) {
        return super.borrow(borrowerId, LOAN_PERIOD);
    }

    // Book特有方法
    public String getAuthor() { return author; }
    public String getIsbn() { return isbn; }
    public int getEdition() { return edition; }
}